package com.share.design.command.demo01;

import java.util.ArrayList;
import java.util.List;

/**
 * 调用者
 * @author caifan
 * @since 2022/11/7
 */
public class WebEditFlow {
    private final List<Command> commandList;

    public WebEditFlow() {
        commandList = new ArrayList<>();
    }

    public void setCommand(Command command) {
        commandList.add(command);
    }

    public void run() {
        for (Command command : commandList) {
            command.execute();
        }
    }

}
